home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / BNU22SR1.ZIP / src / binutils.2 / bfd / archures.c < prev    next >
C/C++ Source or Header  |  1993-05-30  |  16KB  |  731 lines

  1. /* BFD library support routines for architectures.
  2.    Copyright (C) 1990-1991 Free Software Foundation, Inc.
  3.    Hacked by John Gilmore and Steve Chamberlain of Cygnus Support.
  4.  
  5.  
  6. This file is part of BFD, the Binary File Descriptor library.
  7.  
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2 of the License, or
  11. (at your option) any later version.
  12.  
  13. This program is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. GNU General Public License for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with this program; if not, write to the Free Software
  20. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  21.  
  22. /*
  23.  
  24. SECTION
  25.     Architectures
  26.  
  27.     BFD's idea of an architecture is implimented in
  28.     <<archures.c>>. BFD keeps one atom in a BFD describing the
  29.     architecture of the data attached to the BFD;  a pointer to a
  30.     <<bfd_arch_info_type>>.  
  31.  
  32.     Pointers to structures can be requested independently of a bfd
  33.     so that an architecture's information can be interrogated
  34.     without access to an open bfd.
  35.  
  36.     The arch information is provided by each architecture package.
  37.     The set of default architectures is selected by the #define
  38.     <<SELECT_ARCHITECTURES>>.  This is normally set up in the
  39.     <<hosts/host.h>> file of your choice.  If the name is not
  40.     defined, then all the architectures supported are included. 
  41.  
  42.     When BFD starts up, all the architectures are called with an
  43.     initialize method.  It is up to the architecture back end to
  44.     insert as many items into the list of architectures as it wants to;
  45.     generally this would be one for each machine and one for the
  46.     default case (an item with a machine field of 0). 
  47. */
  48.  
  49. /*
  50.  
  51. SUBSECTION
  52.     bfd_architecture
  53.  
  54. DESCRIPTION
  55.     This enum gives the object file's CPU architecture, in a
  56.     global sense --- i.e., what processor family does it belong to?
  57.     There is another field, which indicates what processor within
  58.     the family is in use.  The machine gives a number which
  59.     distingushes different versions of the architecture,
  60.     containing for example 2 and 3 for Intel i960 KA and i960 KB,
  61.     and 68020 and 68030 for Motorola 68020 and 68030. 
  62.  
  63. .enum bfd_architecture 
  64. .{
  65. .  bfd_arch_unknown,   {* File arch not known *}
  66. .  bfd_arch_obscure,   {* Arch known, not one of these *}
  67. .  bfd_arch_m68k,      {* Motorola 68xxx *}
  68. .  bfd_arch_vax,       {* DEC Vax *}   
  69. .  bfd_arch_i960,      {* Intel 960 *}
  70. .    {* The order of the following is important.
  71. .       lower number indicates a machine type that 
  72. .       only accepts a subset of the instructions
  73. .       available to machines with higher numbers.
  74. .       The exception is the "ca", which is
  75. .       incompatible with all other machines except 
  76. .       "core". *}
  77. .
  78. .#define bfd_mach_i960_core      1
  79. .#define bfd_mach_i960_ka_sa     2
  80. .#define bfd_mach_i960_kb_sb     3
  81. .#define bfd_mach_i960_mc        4
  82. .#define bfd_mach_i960_xa        5
  83. .#define bfd_mach_i960_ca        6
  84. .
  85. .  bfd_arch_a29k,      {* AMD 29000 *}
  86. .  bfd_arch_sparc,     {* SPARC *}
  87. .  bfd_arch_mips,      {* MIPS Rxxxx *}
  88. .  bfd_arch_i386,      {* Intel 386 *}
  89. .  bfd_arch_we32k,     {* AT&T WE32xxx *}
  90. .  bfd_arch_tahoe,     {* CCI/Harris Tahoe *}
  91. .  bfd_arch_i860,      {* Intel 860 *}
  92. .  bfd_arch_romp,      {* IBM ROMP PC/RT *}
  93. .  bfd_arch_alliant,   {* Alliant *}
  94. .  bfd_arch_convex,    {* Convex *}
  95. .  bfd_arch_m88k,      {* Motorola 88xxx *}
  96. .  bfd_arch_pyramid,   {* Pyramid Technology *}
  97. .  bfd_arch_h8300,     {* Hitachi H8/300 *}
  98. .  bfd_arch_rs6000,    {* IBM RS/6000 *}
  99. .  bfd_arch_hppa,      {* HP PA RISC *}
  100. .  bfd_arch_z8k,       {* Zilog Z8000 *}
  101. .#define bfd_mach_z8001        1
  102. .#define bfd_mach_z8002        2
  103. .  bfd_arch_h8500,     {* Hitachi H8/500 *}
  104. .  bfd_arch_sh,        {* Hitachi SH *}
  105. .  bfd_arch_alpha,     {* Dec Alpha *}
  106. .  bfd_arch_last
  107. .  };
  108.  
  109.  
  110. */
  111.  
  112. #include "bfd.h"
  113. #include "sysdep.h"
  114. #include "libbfd.h"
  115.  
  116. /*
  117.  
  118. SUBSECTION
  119.     bfd_arch_info
  120.  
  121. DESCRIPTION
  122.     This structure contains information on architectures for use
  123.     within BFD.
  124.  
  125. .
  126. .typedef struct bfd_arch_info 
  127. .{
  128. .  int bits_per_word;
  129. .  int bits_per_address;
  130. .  int bits_per_byte;
  131. .  enum bfd_architecture arch;
  132. .  long mach;
  133. .  char *arch_name;
  134. .  CONST  char *printable_name;
  135. .  unsigned int section_align_power;
  136. . {* true if this is the default machine for the architecture *}
  137. .  boolean the_default;    
  138. .  CONST struct bfd_arch_info * (*compatible)
  139. .    PARAMS ((CONST struct bfd_arch_info *a,
  140. .             CONST struct bfd_arch_info *b));
  141. .
  142. .  boolean (*scan) PARAMS ((CONST struct bfd_arch_info *, CONST char *));
  143. .  {* How to disassemble an instruction, producing a printable
  144. .     representation on a specified stdio stream.  This isn't
  145. .     defined for most processors at present, because of the size
  146. .     of the additional tables it would drag in, and because gdb
  147. .     wants to use a different interface.  *}
  148. .  unsigned int (*disassemble) PARAMS ((bfd_vma addr, CONST char *data,
  149. .                        PTR stream));
  150. .
  151. .  struct bfd_arch_info *next;
  152. .} bfd_arch_info_type;
  153. */
  154.  
  155. bfd_arch_info_type   *bfd_arch_info_list;
  156.  
  157.  
  158. /*
  159. FUNCTION
  160.     bfd_printable_name
  161.  
  162. SYNOPSIS
  163.     CONST char *bfd_printable_name(bfd *abfd);
  164.  
  165. DESCRIPTION
  166.     Return a printable string representing the architecture and machine
  167.     from the pointer to the arch info structure 
  168.  
  169. */
  170.  
  171. CONST char *
  172. DEFUN(bfd_printable_name, (abfd),
  173.       bfd *abfd) 
  174. {
  175.   return abfd->arch_info->printable_name;
  176. }
  177.  
  178.  
  179.  
  180. /*
  181. FUNCTION
  182.     bfd_scan_arch
  183.  
  184. SYNOPSIS
  185.     bfd_arch_info_type *bfd_scan_arch(CONST char *);
  186.  
  187. DESCRIPTION
  188.     This routine is provided with a string and tries to work out
  189.     if bfd supports any cpu which could be described with the name
  190.     provided.  The routine returns a pointer to an arch_info
  191.     structure if a machine is found, otherwise NULL.
  192.  
  193. */
  194.  
  195. bfd_arch_info_type *
  196. DEFUN(bfd_scan_arch,(string),
  197.       CONST char *string)
  198. {
  199.   struct bfd_arch_info *ap;
  200.  
  201.   /* Look through all the installed architectures */
  202.   for (ap = bfd_arch_info_list;
  203.        ap != (bfd_arch_info_type *)NULL;
  204.        ap = ap->next) {
  205.  
  206.     if (ap->scan(ap, string)) 
  207.       return ap;
  208.   }
  209.   return (bfd_arch_info_type *)NULL;
  210. }
  211.  
  212.  
  213.  
  214. /*
  215. FUNCTION
  216.     bfd_arch_get_compatible
  217.  
  218. SYNOPSIS
  219.     CONST bfd_arch_info_type *bfd_arch_get_compatible(
  220.         CONST bfd *abfd,
  221.             CONST bfd *bbfd);
  222.  
  223. DESCRIPTION
  224.     This routine is used to determine whether two BFDs'
  225.     architectures and achine types are compatible.  It calculates
  226.     the lowest common denominator between the two architectures
  227.     and machine types implied by the BFDs and returns a pointer to
  228.     an arch_info structure describing the compatible machine.
  229. */
  230.  
  231. CONST bfd_arch_info_type *
  232. DEFUN(bfd_arch_get_compatible,(abfd, bbfd),
  233. CONST    bfd *abfd AND
  234. CONST    bfd *bbfd)
  235.  
  236. {
  237.   return  abfd->arch_info->compatible(abfd->arch_info,bbfd->arch_info);
  238. }
  239.  
  240.  
  241. /*
  242. INTERNAL_DEFINITION
  243.     bfd_default_arch_struct
  244.  
  245. DESCRIPTION
  246.     The <<bfd_default_arch_struct>> is an item of
  247.     <<bfd_arch_info_type>> which has been initialized to a fairly
  248.     generic state.  A BFD starts life by pointing to this
  249.     structure, until the correct back end has determined the real
  250.     architecture of the file.
  251.  
  252. .extern bfd_arch_info_type bfd_default_arch_struct;
  253.  
  254. */
  255.  
  256. bfd_arch_info_type bfd_default_arch_struct =
  257. {
  258.     32,32,8,bfd_arch_unknown,0,"unknown","unknown",1,true,
  259.     bfd_default_compatible,
  260.     bfd_default_scan, 
  261.     0,
  262. };
  263.  
  264. /*
  265. FUNCTION
  266.     bfd_set_arch_info
  267.  
  268. SYNOPSIS
  269.     void bfd_set_arch_info(bfd *, bfd_arch_info_type *);
  270.  
  271. */
  272.  
  273. void DEFUN(bfd_set_arch_info,(abfd, arg),
  274. bfd *abfd AND
  275. bfd_arch_info_type *arg)
  276. {
  277.   abfd->arch_info = arg;
  278. }
  279.  
  280. /*
  281. INTERNAL_FUNCTION
  282.     bfd_default_set_arch_mach
  283.  
  284. SYNOPSIS
  285.     boolean bfd_default_set_arch_mach(bfd *abfd,
  286.         enum bfd_architecture arch,
  287.         unsigned long mach);
  288.  
  289. DESCRIPTION
  290.     Set the architecture and machine type in a bfd. This finds the
  291.     correct pointer to structure and inserts it into the arch_info
  292.     pointer. 
  293. */
  294.  
  295. boolean DEFUN(bfd_default_set_arch_mach,(abfd, arch, mach),
  296.           bfd *abfd AND
  297.           enum bfd_architecture arch AND
  298.           unsigned    long mach)
  299. {
  300.   static struct bfd_arch_info *old_ptr = &bfd_default_arch_struct;
  301.   boolean found = false;
  302.   /* run through the table to find the one we want, we keep a little
  303.      cache to speed things up */
  304.   if (old_ptr == 0 || arch != old_ptr->arch || mach != old_ptr->mach) {
  305.     bfd_arch_info_type *ptr;
  306.     old_ptr = (bfd_arch_info_type *)NULL;
  307.     for (ptr = bfd_arch_info_list;
  308.      ptr != (bfd_arch_info_type *)NULL;
  309.      ptr= ptr->next) {
  310.       if (ptr->arch == arch &&
  311.       ((ptr->mach == mach) || (ptr->the_default && mach == 0))) {
  312.     old_ptr = ptr;
  313.     found = true;
  314.     break;
  315.       }
  316.     }
  317.     if (found==false) {
  318.       /*looked for it and it wasn't there, so put in the default */
  319.       old_ptr = &bfd_default_arch_struct;
  320.  
  321.     }
  322.   }
  323.   else {
  324.     /* it was in the cache */
  325.     found = true;
  326.   }
  327.  
  328.   abfd->arch_info = old_ptr;
  329.  
  330.   return found;
  331. }
  332.  
  333.  
  334.  
  335.  
  336.  
  337. /*
  338. FUNCTION
  339.     bfd_get_arch
  340.  
  341. SYNOPSIS
  342.     enum bfd_architecture bfd_get_arch(bfd *abfd);
  343.  
  344. DESCRIPTION
  345.     Returns the enumerated type which describes the supplied bfd's
  346.     architecture
  347.  
  348. */
  349.  
  350. enum bfd_architecture DEFUN(bfd_get_arch, (abfd), bfd *abfd)
  351. {
  352.     return abfd->arch_info->arch;
  353. }
  354.  
  355. /*
  356. FUNCTION
  357.     bfd_get_mach
  358.  
  359. SYNOPSIS
  360.     unsigned long bfd_get_mach(bfd *abfd);
  361.  
  362. DESCRIPTION
  363.     Returns the long type which describes the supplied bfd's
  364.     machine
  365. */
  366.  
  367. unsigned long  
  368. DEFUN(bfd_get_mach, (abfd), bfd *abfd)
  369. {
  370.     return abfd->arch_info->mach;
  371. }
  372.  
  373. /*
  374. FUNCTION
  375.     bfd_arch_bits_per_byte
  376.  
  377. SYNOPSIS
  378.     unsigned int bfd_arch_bits_per_byte(bfd *abfd);
  379.  
  380. DESCRIPTION
  381.     Returns the number of bits in one of the architectures bytes
  382.  
  383. */
  384.  
  385. unsigned int DEFUN(bfd_arch_bits_per_byte, (abfd), bfd *abfd)
  386.   {
  387.     return abfd->arch_info->bits_per_byte;
  388.   }
  389.  
  390. /*
  391. FUNCTION
  392.     bfd_arch_bits_per_address
  393.  
  394. SYNOPSIS
  395.     unsigned int bfd_arch_bits_per_address(bfd *abfd);
  396.  
  397. DESCRIPTION
  398.     Returns the number of bits in one of the architectures addresses
  399. */
  400.  
  401. unsigned int DEFUN(bfd_arch_bits_per_address, (abfd), bfd *abfd)
  402.   {
  403.     return abfd->arch_info->bits_per_address;
  404.   }
  405.  
  406.  
  407.  
  408. extern void bfd_h8300_arch PARAMS ((void));
  409. extern void bfd_sh_arch PARAMS ((void));
  410. extern void bfd_h8500_arch PARAMS ((void));
  411. extern void bfd_alpha_arch PARAMS ((void));
  412. extern void bfd_i960_arch PARAMS ((void));
  413. extern void bfd_empty_arch PARAMS ((void));
  414. extern void bfd_sparc_arch PARAMS ((void));
  415. extern void bfd_m88k_arch PARAMS ((void));
  416. extern void bfd_m68k_arch PARAMS ((void));
  417. extern void bfd_vax_arch PARAMS ((void));
  418. extern void bfd_a29k_arch PARAMS ((void));
  419. extern void bfd_mips_arch PARAMS ((void));
  420. extern void bfd_i386_arch PARAMS ((void));
  421. extern void bfd_rs6000_arch PARAMS ((void));
  422. extern void bfd_hppa_arch PARAMS ((void));
  423. extern void bfd_z8k_arch PARAMS ((void));
  424. extern void bfd_we32k_arch PARAMS ((void));
  425.  
  426. static void (*archures_init_table[]) PARAMS ((void)) = 
  427. {
  428. #ifdef SELECT_ARCHITECTURES
  429.   SELECT_ARCHITECTURES,
  430. #else
  431.   bfd_sparc_arch,
  432.   bfd_a29k_arch,
  433.   bfd_mips_arch,
  434.   bfd_h8300_arch,
  435.   bfd_h8500_arch,
  436.   bfd_alpha_arch,
  437.   bfd_i386_arch,
  438.   bfd_m88k_arch,
  439.   bfd_i960_arch,
  440.   bfd_m68k_arch,
  441.   bfd_vax_arch,
  442.   bfd_rs6000_arch,
  443.   bfd_hppa_arch,
  444.   bfd_z8k_arch,
  445.   bfd_we32k_arch,
  446. #endif
  447.   0
  448.   };
  449.  
  450.  
  451.  
  452. /*
  453. INTERNAL_FUNCTION 
  454.     bfd_arch_init
  455.  
  456. SYNOPSIS
  457.     void  bfd_arch_init(void);
  458.  
  459. DESCRIPTION
  460.     This routine initializes the architecture dispatch table by
  461.     calling all installed architecture packages and getting them
  462.     to poke around.
  463. */
  464.  
  465. void
  466. DEFUN_VOID(bfd_arch_init)
  467. {
  468.     void (**ptable) PARAMS ((void));
  469.     for (ptable = archures_init_table; 
  470.      *ptable ;
  471.      ptable++)
  472.     {
  473.     (*ptable)();
  474.     }
  475. }
  476.  
  477.  
  478. /*
  479. INTERNAL_FUNCTION
  480.     bfd_arch_linkin
  481.  
  482. SYNOPSIS
  483.     void bfd_arch_linkin(bfd_arch_info_type *);
  484.  
  485. DESCRIPTION
  486.     Link the provided arch info structure into the list
  487. */
  488.  
  489. void DEFUN(bfd_arch_linkin,(ptr),
  490.        bfd_arch_info_type *ptr)
  491. {
  492.   ptr->next = bfd_arch_info_list;
  493.   bfd_arch_info_list = ptr;
  494. }
  495.  
  496.  
  497. /*
  498. INTERNAL_FUNCTION 
  499.     bfd_default_compatible
  500.  
  501. SYNOPSIS
  502.     CONST bfd_arch_info_type *bfd_default_compatible
  503.     (CONST bfd_arch_info_type *a,
  504.     CONST bfd_arch_info_type *b);
  505.  
  506. DESCRIPTION
  507.     The default function for testing for compatibility.
  508. */
  509.  
  510. CONST bfd_arch_info_type *
  511. DEFUN(bfd_default_compatible,(a,b),
  512.       CONST bfd_arch_info_type *a AND
  513.       CONST bfd_arch_info_type *b)
  514. {
  515.   if(a->arch != b->arch) return NULL;
  516.  
  517.   if (a->mach > b->mach) {
  518.     return a;
  519.   }
  520.   if (b->mach > a->mach) {
  521.     return b;
  522.   }
  523.   return a;
  524. }
  525.  
  526.  
  527. /*
  528. INTERNAL_FUNCTION
  529.     bfd_default_scan
  530.  
  531. SYNOPSIS
  532.     boolean bfd_default_scan(CONST struct bfd_arch_info *, CONST char *);
  533.  
  534. DESCRIPTION
  535.     The default function for working out whether this is an
  536.     architecture hit and a machine hit.
  537. */
  538.  
  539. boolean 
  540. DEFUN(bfd_default_scan,(info, string),
  541. CONST struct bfd_arch_info *info AND
  542. CONST char *string)
  543. {
  544.     CONST  char *ptr_src;
  545.     CONST   char *ptr_tst;
  546.     unsigned long number;
  547.     enum bfd_architecture arch;
  548.     /* First test for an exact match */
  549.     if (strcmp(string, info->printable_name) == 0) return true;
  550.  
  551.     /* See how much of the supplied string matches with the
  552.        architecture, eg the string m68k:68020 would match the 68k entry
  553.        up to the :, then we get left with the machine number */
  554.  
  555.     for (ptr_src = string,
  556.      ptr_tst = info->arch_name; 
  557.      *ptr_src && *ptr_tst;
  558.      ptr_src++,
  559.      ptr_tst++) 
  560.     {
  561.     if (*ptr_src != *ptr_tst) break;
  562.     }
  563.  
  564.     /* Chewed up as much of the architecture as will match, skip any
  565.        colons */
  566.     if (*ptr_src == ':') ptr_src++;
  567.   
  568.     if (*ptr_src == 0) {
  569.         /* nothing more, then only keep this one if it is the default
  570.            machine for this architecture */
  571.         return info->the_default;
  572.     }
  573.     number = 0;
  574.     while (isdigit(*ptr_src)) {
  575.         number = number * 10 + *ptr_src  - '0';
  576.         ptr_src++;
  577.     }
  578.  
  579.     switch (number) 
  580.     {
  581.      case 300:
  582.       arch = bfd_arch_h8300;
  583.       break;
  584.  
  585.      case 500:
  586.       arch = bfd_arch_h8500;
  587.       break;
  588.  
  589.       case 68010:
  590.       case 68020:
  591.       case 68030:
  592.       case 68040:
  593.       case 68332:
  594.       case 68050:        
  595.       case 68000: 
  596.     arch = bfd_arch_m68k; 
  597.     break;
  598.       case 386: 
  599.       case 80386:
  600.       case 486:
  601.       case 80486:
  602.     arch = bfd_arch_i386;
  603.     break;
  604.       case 29000: 
  605.     arch = bfd_arch_a29k;
  606.     break;
  607.  
  608.        case 8000:
  609.     arch = bfd_arch_z8k;
  610.     break;
  611.  
  612.       case 32000:
  613.     arch = bfd_arch_we32k;
  614.     break;
  615.  
  616.       case 860:
  617.       case 80860: 
  618.     arch = bfd_arch_i860; 
  619.     break;
  620.       case 960:
  621.       case 80960:
  622.     arch = bfd_arch_i960;
  623.     break;
  624.  
  625.       case 2000:
  626.       case 3000:
  627.       case 4000:
  628.       case 4400:
  629.         arch = bfd_arch_mips;
  630.         break;
  631.  
  632.       case 6000:
  633.     arch = bfd_arch_rs6000;
  634.     break;
  635.  
  636.       default:  
  637.     return false;
  638.     }
  639.     if (arch != info->arch) 
  640.      return false;
  641.  
  642.     if (number != info->mach)
  643.      return false;
  644.  
  645.     return true;
  646. }
  647.  
  648.  
  649.  
  650.  
  651. /*
  652. FUNCTION
  653.     bfd_get_arch_info
  654.  
  655.  
  656. SYNOPSIS
  657.     bfd_arch_info_type * bfd_get_arch_info(bfd *);
  658.  
  659. */
  660.  
  661. bfd_arch_info_type *
  662. DEFUN(bfd_get_arch_info,(abfd),
  663. bfd *abfd)
  664. {
  665.   return  abfd->arch_info;
  666. }
  667.  
  668.  
  669. /*
  670. FUNCTION
  671.     bfd_lookup_arch
  672.  
  673. SYNOPSIS
  674.     bfd_arch_info_type *bfd_lookup_arch
  675.         (enum bfd_architecture
  676.         arch,
  677.         long machine);
  678.  
  679. DESCRIPTION
  680.     Look for the architecure info struct which matches the
  681.     arguments given. A machine of 0 will match the
  682.     machine/architecture structure which marks itself as the
  683.     default.
  684. */
  685.  
  686. bfd_arch_info_type * 
  687. DEFUN(bfd_lookup_arch,(arch, machine),
  688. enum bfd_architecture arch AND
  689. long machine)
  690. {
  691.     bfd_arch_info_type *ap;
  692.     bfd_check_init();  
  693.     for (ap = bfd_arch_info_list; 
  694.      ap !=  (bfd_arch_info_type *)NULL;
  695.      ap = ap->next) {
  696.         if (ap->arch == arch &&
  697.         ((ap->mach == machine) 
  698.          || (ap->the_default && machine == 0))) {
  699.             return ap;
  700.         }
  701.     }
  702.     return (bfd_arch_info_type *)NULL;
  703. }
  704.  
  705.  
  706.  
  707. /*
  708. FUNCTION
  709.     bfd_printable_arch_mach
  710.  
  711. SYNOPSIS
  712.     CONST char * bfd_printable_arch_mach
  713.         (enum bfd_architecture arch, unsigned long machine);
  714.  
  715. DESCRIPTION
  716.     Return a printable string representing the architecture and
  717.     machine type. 
  718.  
  719.     NB. The use of this routine is depreciated.
  720. */
  721.  
  722. CONST char *
  723. DEFUN(bfd_printable_arch_mach,(arch, machine),
  724.       enum bfd_architecture arch AND
  725.       unsigned long machine)
  726. {
  727.     bfd_arch_info_type *ap = bfd_lookup_arch(arch, machine);
  728.     if(ap) return ap->printable_name;
  729.     return "UNKNOWN!";
  730. }
  731.